import myAjax from '../static/myAjax.js'

window.onload = function () {

    // 退出登录
    if (document.getElementById('logout')) {
        document.getElementById('logout').onclick = function () {
            myAjax('/backstage/logout', 'GET')
                .then(
                    res => {
                        if (res.code == 200) {
                            sessionStorage.removeItem("userName");
                            location.href = res.url;
                        }
                    }
                )
        }
    }
}